///////////////////////////////////////////////////////////////////////////
//
// Spring Engine Source File.
// Copyright (C), Dengtao 2011-2021
// ----------------------------------------------------------------------
// File name:   SfNotificationExtraInfo.h
// Version:     v1.0.0
// Created:     2013/06/21 21:19 by dengtao
// Compilers:   Visual Studio 2008
// Description: 
// ----------------------------------------------------------------------
// History:
//
///////////////////////////////////////////////////////////////////////////

#ifndef _SfNotificationExtraInfo_H_
#define _SfNotificationExtraInfo_H_

#include "SfBaseDefines.h"
#include "SfRefObject.h"
#include "SfSmartPtr.h"
#include <string>

namespace Sunflower
{
//////////////////////////////////////////////////////////////////////////
//Summary:
//	base class of user information of notification.
//////////////////////////////////////////////////////////////////////////
class NotificationExtraInfo : public RefObject
{
public:
	//Summary:
	//	access key.
	const std::string& GetKey() const { return m_KeyStr; }
	std::string& GetKey() { return m_KeyStr; }

	//
	//Summary:
	//	set key.
	;void SetKey(const char* key);

protected:
	NotificationExtraInfo(const NotificationExtraInfo&);
	NotificationExtraInfo& operator =(const NotificationExtraInfo&);

private:
	std::string m_KeyStr;
};

//
//Summary:
//	set key.
inline void NotificationExtraInfo::SetKey(const char* key)
{ 
	if (SfIsValidPtr(key)) 
	{
		m_KeyStr = key;
	} 
	else
	{
		m_KeyStr = "";
	}
}

SfDeclareSmartPtr(NotificationExtraInfo);

}

#endif
